<div id="information">
<br /><br />
<?php
$sel_group=mysql_query('SELECT * FROM groups WHERE id="'.$_GET['id'].'" AND from_who="'.$_SESSION['username'].'"');
$row_group=mysql_fetch_assoc($sel_group);

$sel_home = "SELECT * FROM homework WHERE username = '".$row_group['from_who']."' AND title_group = '".$row_group['title_group']."'";
$sel_home_q = mysql_query($sel_home);
$sel_home_broi = mysql_num_rows($sel_home_q);
?>
<div id='news_homework'>
	<p><i>
		<ul type='square' style='left: -10px;'>
			<?php
				$broqch = 1;
				if($sel_home_broi != 0) {
				while($sel_home_Q_fetch = mysql_fetch_assoc($sel_home_q)) {
				    $sel_art = mysql_query('SELECT * FROM articles WHERE article_descr = "'.$sel_home_Q_fetch['descr'].'"');
					$row_art = mysql_fetch_assoc($sel_art);
					
					echo '<li>'.$broqch.' | <i>'.date('Y-m-d / g:i:s', $sel_home_Q_fetch['date']).'</i> | <strong>'.ucfirst($sel_home_Q_fetch['descr'])."</strong> - <i>може да отворите урока от </i><strong><a href='../tutorials/see_articles.php?name=".$row_art['to_tutorial']."&amp;module=".$row_art['place']."&amp;id=".$row_art['article_id']."'>ТУК!</a></strong>".'</li>'; 
					$broqch++;
				} 
				} else echo "<li><i>Няма предложени уроци!</i></li>";
			?>
		</ul>
	</i></p>
</div><br />
<?php
include "ins_gr.php";
?>
	<p class='proffile_group_box'><a class="activate_modal regi" name='modal_window4'><strong>Профил на групата</strong></a></p>
	
	<div id='mask' class='close_modal'></div>
	<div id='modal_window4' class='modal_window' style='font-family: Verdana,Helvetica,Arial,sans-serif;font-size: 13px;'>
	<h3>Профил на групата</h3><p style='font-family: Verdana,Helvetica,Arial,sans-serif;font-size: 13px;'>
	<table border='0px' width='400px' style='font-family: Verdana,Helvetica,Arial,sans-serif;font-size: 13px;'>
		<tr>
			<td width='150px'>Съдадено от:</td><td><?php echo $row_group['from_who'];?></td>
		</tr>
		<tr>
			<td width='150px'>Тема на групата:</td><td><?php echo $row_group['title_group'];?></td>
		</tr>
		<tr>
			<td width='150px'>Участници:</td><td><?php echo $row_group['names'];?></td>
		</tr>
		<tr>
			<td width='150px'>Раздел:</td><td><?php echo $row_group['tutorial'];?></td>
		</tr>
		<tr>
			<td width='150px'>Създадено през:</td><td><?php echo date('Y-m-d / G:i:s', $row_group['date']);?></td>
		</tr></p>
	</table>
	
	</div>


	<div id='pic_user' style='float: left;margin-top: 20px;'>
	<?php
	$username=$_SESSION['username'];
			$select_user=mysql_query('SELECT * FROM users WHERE username="'.$username.'"');
			$row_user=mysql_fetch_assoc($select_user);
			if(mysql_num_rows($select_avatar)==1){
					  $img="<img src='../user_pics/".$row_avatar[pic_name]."' width='120' height='120' style='border: 2px solid black;box-shadow: 5px 5px 5px #000' alt='avatar'/>";
			}
			else{
				  $img="<img src='../user_pics/default.png' width='120' height='120' style='border: 2px solid black;box-shadow: 5px 5px 5px #000' alt='avatar'/>";
			}
			echo '<p style="height: 170px; width: 144px; border-right: 1px solid #000;">'.$img.'</p>';
	?>
		
	</div>
	<div id='write'>
			<div class='boxx'>
				<form method='post' action=''>
					<table><tr>
						<td><input type='text' name='message_group' id='message_group' /></td>
						<td><input type='submit' name='submit' id='submit' value='Запиши' /></td>
					</tr></table>
				</form>
			</div>
			
			<br />
			<hr width='90%' />
			<br />
			
			<div id='groupBox'>
			<?php
			$roow = $row_group['title_group'];
			
			$ss_mess = mysql_query('SELECT * FROM groups_mess WHERE `title_group` = "'.$roow.'" ORDER BY date DESC') or die(mysql_error());
			echo "<ul type='square'>";
				while($row_messe = mysql_fetch_assoc($ss_mess)) {
					echo '<li><i>'.date('Y-m-d / g:i:s', $row_messe['date']).'</i> | <strong>'.ucfirst($row_messe['who_comment'])."</strong> - ".ucfirst($row_messe['comment']).'</li><br />'; 
				}
				echo "</ul>";
			?>
			</div>
			
	</div>
	<?php 
	?>
</div>
<br />
<br />
<br />
